#pragma once
#include "Core.h"
#include "spdlog/spdlog.h"
#include "spdlog/fmt/ostr.h"

namespace Baby {

	class BABY_API Log
	{
	public:
		static void Init();

		inline static std::shared_ptr<spdlog::logger>& GetCoreLogger() { return s_CoreLogger; }
		inline static std::shared_ptr<spdlog::logger>& GetClientLogger() { return s_ClientLogger; }

	private:
		static std::shared_ptr<spdlog::logger> s_CoreLogger;
		static std::shared_ptr<spdlog::logger> s_ClientLogger;
	};
}

// Core log macros
#define BY_CORE_TRACE(...)			::Baby::Log::GetCoreLogger()->trace(__VA_ARGS__)
#define BY_CORE_INFO(...)			::Baby::Log::GetCoreLogger()->info(__VA_ARGS__)
#define BY_CORE_WARN(...)			::Baby::Log::GetCoreLogger()->warn(__VA_ARGS__)
#define BY_CORE_ERROR(...)			::Baby::Log::GetCoreLogger()->error(__VA_ARGS__)
#define BY_CORE_FATAL(...)			::Baby::Log::GetCoreLogger()->fatal(__VA_ARGS__)

// Client log macros
#define BY_TRACE(...)				::Baby::Log::GetClientLogger()->trace(__VA_ARGS__)
#define BY_INFO(...)				::Baby::Log::GetClientLogger()->info(__VA_ARGS__)
#define BY_WARN(...)				::Baby::Log::GetClientLogger()->warn(__VA_ARGS__)
#define BY_ERROR(...)				::Baby::Log::GetClientLogger()->error(__VA_ARGS__)
#define BY_FATAL(...)				::Baby::Log::GetClientLogger()->fatal(__VA_ARGS__)

